using System;
using System.Collections;
using System.Net;
using System.Text;
using System.Threading;
using System.Web;
public class AlimamaUtil
{
	private static string string_0 = "http://pub.alimama.com/event/squareList.json?orderType=3&key=&toPage={pageno}&perPageSize=100&platformType=-1&catId=-1&commissionRangeType=-1&eventStatus=-1&highQuality=-1&promotionType=-1&_tb_token_={tbtoken}&_input_charset=utf-8";
	private static string string_1 = "http://pub.alimama.com/event/detail.json?eventId={brdgId}&_tb_token_={tbtoken}&_input_charset=utf-8";
	private static string string_2 = "http://temai.taobao.com/event/items.json?toPage={pageno}&perPageSize=2000&catId=&tagId=&pid={pid}&unid=&platformType=&isPreview=0&id={brdgId}&t={t}&pvid={pvid}";
	public static bool check_login()
	{
		return AlimamaUtil.check_login(CookieUtil.get_cookie("http://www.alimama.com"));
	}
	public static bool check_login(string cookie)
	{
		bool result;
		try
		{
			string format = "http://pub.alimama.com/common/getUnionPubContextInfo.json";
			string address = string.Format(format, "ABC");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", cookie);
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text;
			if ("gzip".Equals(value))
			{
				text = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text = Encoding.UTF8.GetString(array);
			}
			if (text.Contains("\"message\":\"nologin\"") || (text.Contains("status") && text.Contains("wait")))
			{
				result = false;
			}
			else
			{
				if (text.Contains("\"nologin\"") || text.Contains("\"noLogin\""))
				{
					result = false;
				}
				else
				{
					result = true;
				}
			}
		}
		catch
		{
			result = false;
		}
		return result;
	}
	public static void smethod_10(string string_3, string string_4, string string_5, string string_6, out string string_7)
	{
		try
		{
			string newValue = StringUtil.subString(string_6, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("Origin", "http://pub.alimama.com");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.jLGE9b");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_6);
			string address = "http://pub.alimama.com/common/site/generalize/guideAdd.json";
			string text = "name={name}&categoryId={categoryId}&account1={account}&t={timestamp}&pvid=&_tb_token_={token}";
			text = text.Replace("{name}", string_3).Replace("{categoryId}", string_4).Replace("{account}", string_5).Replace("{token}", newValue).Replace("{timestamp}", string.Concat(AlimamaUtil.current_time()));
			byte[] array = webClient.UploadData(address, "POST", Encoding.UTF8.GetBytes(text));
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			if (text2.Contains("\"message\":null") && text2.Contains("\"ok\":true"))
			{
				string_7 = "自动创建推广渠道成功！";
			}
			else
			{
				string str = StringUtil.subString(text2, 0, "\"message\":\"", "\"");
				string_7 = "自动创建推广渠道【失败】！失败原因：【" + str + "】";
			}
		}
		catch (Exception ex)
		{
			string_7 = "出错啦！！！" + ex.ToString();
		}
	}
	public static void smethod_11(string string_3, string string_4, string string_5, string string_6, out string string_7)
	{
		try
		{
			string newValue = StringUtil.subString(string_6, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("Origin", "http://pub.alimama.com");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.jLGE9b");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_6);
			string address = "http://pub.alimama.com/common/adzone/selfAdzoneCreate.json";
			string text = "promotion_type={promottype}%23{promottype}&gcid=8&siteid={siteid}&selectact=add&newadzonename={newadzonename}&channelIds=&t={timestamp}&pvid={pvid}&_tb_token_={token}";
			text = text.Replace("{promottype}", string_3).Replace("{siteid}", string_4).Replace("{newadzonename}", string_5).Replace("{token}", newValue).Replace("{timestamp}", string.Concat(AlimamaUtil.current_time())).Replace("{pvid}", AlimamaUtil.query_pvid(string_6));
			byte[] array = webClient.UploadData(address, "POST", Encoding.UTF8.GetBytes(text));
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			if (text2.Contains("\"message\":null") && text2.Contains("\"ok\":true"))
			{
				string_7 = "自动创建推广位成功！";
			}
			else
			{
				string str = StringUtil.subString(text2, 0, "\"message\":\"", "\"");
				string_7 = "自动创建推广位【失败】！失败原因：【" + str + "】";
			}
		}
		catch (Exception ex)
		{
			string_7 = "出错啦！！！" + ex.ToString();
		}
	}
	public static ArrayList smethod_12(string string_3, string string_4, string string_5, string string_6, out string string_7)
	{
		ArrayList result;
		try
		{
			string newValue = StringUtil.subString(string_6, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_6);
			string text = "http://pub.alimama.com/report/getTbkPaymentDetails.json?startTime={startTime}&endTime={endTime}&payStatus=&queryType=1&toPage={toPage}&perPageSize=20&total=&_tb_token_={_tb_token_}&_input_charset=utf-8";
			text = text.Replace("{startTime}", string_3).Replace("{endTime}", string_4).Replace("{toPage}", string_5).Replace("{_tb_token_}", newValue);
			byte[] array = webClient.DownloadData(text);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			ArrayList arrayList = new ArrayList();
			int num = text2.IndexOf("paymentList");
			while ((num = AlimamaUtil.smethod_13(text2, num)) != -1)
			{
				PayOrder payOrder = new PayOrder();
				payOrder.taobaoTradeParentId = StringUtil.subString(text2, num, "\"taobaoTradeParentId\":", ",");
				payOrder.num_iid = StringUtil.subString(text2, num, "\"auctionId\":", ",");
				payOrder.title = StringUtil.subString(text2, num, "\"auctionTitle\":\"", "\"");
				payOrder.shop_title = StringUtil.subString(text2, num, "\"exShopTitle\":\"", "\"");
				payOrder.payStatus = StringUtil.subString(text2, num, "\"payStatus\":", ",");
				payOrder.auctionNum = StringUtil.subString(text2, num, "\"auctionNum\":", ",");
				payOrder.totalAlipayFeeString = StringUtil.subString(text2, num, "\"totalAlipayFeeString\":\"", "\"");
				payOrder.feeString = StringUtil.subString(text2, num, "\"feeString\":\"", "\"");
				payOrder.discountAndSubsidyToString = StringUtil.subString(text2, num, "\"discountAndSubsidyToString\":\"", "\"");
				payOrder.createTime = StringUtil.subString(text2, num, "\"createTime\":\"", "\"");
				payOrder.earningTime = StringUtil.subString(text2, num, "\"earningTime\":", ",");
				if (payOrder.earningTime.Contains("null"))
				{
					payOrder.earningTime = "";
				}
				else
				{
					payOrder.earningTime = payOrder.earningTime.Replace("\"", "");
				}
				payOrder.terminalType = StringUtil.subString(text2, num, "\"terminalType\":\"", "\"");
				arrayList.Add(payOrder);
				num++;
			}
			string_7 = "";
			result = arrayList;
		}
		catch (Exception ex)
		{
			string_7 = "出错啦！！！" + ex.ToString();
			result = null;
		}
		return result;
	}
	private static int smethod_13(string string_3, int int_0)
	{
		int num = string_3.IndexOf("{\"auctionUrl\"", int_0);
		if (num == -1)
		{
			num = string_3.IndexOf("{\"createTime\"", int_0);
		}
		return num;
	}
	public static StoreItem2 smethod_14(string string_3, string string_4, out string string_5)
	{
		StoreItem2 result;
		try
		{
			string text = StringUtil.subString(string_4, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_4);
			byte[] array = webClient.DownloadData(string.Concat(new string[]
			{
				"http://pub.alimama.com/shopdetail/shopinfo.json?oriMemberId=",
				string_3,
				"&_tb_token_=",
				text,
				"&_input_charset=utf-8"
			}));
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			string text3 = StringUtil.subString(text2, 0, "\"shopTitle\":\"", "\"");
			string text4 = StringUtil.subString(text2, 0, "\"shopCatName\":\"", "\"");
			if (text4 == null || "".Equals(text4))
			{
				text4 = StringUtil.subString(text2, 0, "\"Ind\":[\"", "\"");
			}
			StoreItem2 storeItem = new StoreItem2();
			storeItem.string_0 = text3;
			storeItem.string_1 = text4;
			storeItem.string_2 = StringUtil.subString(text2, 0, "\"extNick\":\"", "\"");
			string_5 = "";
			result = storeItem;
		}
		catch (Exception ex)
		{
			string_5 = "出错啦！！！" + ex.ToString();
			result = null;
		}
		return result;
	}
	public static ArrayList smethod_15(string string_3, string string_4, out string string_5)
	{
		string newValue = StringUtil.subString(string_4, 0, "_tb_token_=", ";");
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_4);
		string text = "http://pub.alimama.com/items/search.json?q={schKey}&auctionTag=&perPageSize=40&shopTag=&t={timestamp}&_tb_token_={tbToken}&pvid={pvid}";
		text = text.Replace("{schKey}", HttpUtility.UrlEncode(string_3)).Replace("{tbToken}", newValue).Replace("{timestamp}", string.Concat(AlimamaUtil.current_time())).Replace("{pvid}", AlimamaUtil.query_pvid(string_4));
		string text2 = "";
		byte[] array = webClient.DownloadData(text);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		if ("gzip".Equals(value))
		{
			text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text2 = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		if (text2.IndexOf("\"length\":0") != -1)
		{
			string_5 = "";
			return arrayList;
		}
		string value2 = "\"" + StringUtil.subString(text2, 0, "\"pagelist\":[{\"", "\"") + "\"";
		int num = 0;
		while (true)
		{
			num = text2.IndexOf(value2, num);
			if (num == -1)
			{
				break;
			}
			GoodsItem5 goodsItem = new GoodsItem5();
			goodsItem.user_num_id = StringUtil.subString(text2, num, "\"userNumberId\":\"", "\"");
			if ("".Equals(goodsItem.user_num_id))
			{
				goodsItem.user_num_id = StringUtil.subString(text2, num, "\"userNumberId\":", ",");
			}
			goodsItem.title = GzipUtil.html_to_text(StringUtil.subString(text2, num, "\"title\":\"", "\","));
			goodsItem.pic_url = GzipUtil.html_to_text(StringUtil.subString(text2, num, "\"pictUrl\":\"", "\","));
			goodsItem.price = StringUtil.subString(text2, num, "\"zkPrice\":", ",");
			goodsItem.ori_price = StringUtil.subString(text2, num, "\"reservePrice\":", ",");
			goodsItem.user_type = StringUtil.subString(text2, num, "\"userType\":", ",");
			goodsItem.nick = StringUtil.subString(text2, num, "\"nick\":\"", "\"");
			goodsItem.num_iid = StringUtil.subString(text2, num, "\"auctionId\":\"", "\"");
			if ("".Equals(goodsItem.num_iid))
			{
				goodsItem.num_iid = StringUtil.subString(text2, num, "\"auctionId\":", ",");
			}
			goodsItem.commissionRatePercent = StringUtil.subString(text2, num, "\"commissionRatePercent\":", ",");
			try
			{
				goodsItem.volume = int.Parse(StringUtil.subString(text2, num, "\"totalNum\":", ","));
			}
			catch
			{
			}
			arrayList.Add(goodsItem);
			num++;
		}
		if (arrayList.Count == 0)
		{
			string_5 = text2;
		}
		else
		{
			string_5 = "";
		}
		return arrayList;
	}
	public static ArrayList smethod_16(string string_3, string string_4, string string_5, int int_0, string string_6, out string string_7)
	{
		if (string_4.Equals(""))
		{
			string_4 = "_totalfee";
		}
		return AlimamaUtil.smethod_19("&user_type=", string_3, string_4, string_5, int_0, string_6, out string_7);
	}
	public static ArrayList smethod_17(string string_3, string string_4, string string_5, int int_0, string string_6, out string string_7)
	{
		if (string_4.Equals(""))
		{
			string_4 = "_totalfee";
		}
		return AlimamaUtil.smethod_19("&user_type=1", string_3, string_4, string_5, int_0, string_6, out string_7);
	}
	public static ArrayList smethod_18(string string_3, string string_4, string string_5, int int_0, string string_6, out string string_7)
	{
		if (string_4.Equals(""))
		{
			string_4 = "_totalfee";
		}
		return AlimamaUtil.smethod_19("&user_type=0", string_3, string_4, string_5, int_0, string_6, out string_7);
	}
	public static ArrayList smethod_19(string string_3, string string_4, string string_5, string string_6, int int_0, string string_7, out string string_8)
	{
		string text = "http://pub.alimama.com/pubauc/searchAuctionList.json?q={pSchKey}&toPage={toPage}&sort={sort}{type}&perPagesize=40{schCond}";
		return AlimamaUtil.smethod_21(text.Replace("{pSchKey}", HttpUtility.UrlEncode(string_4)).Replace("{sort}", string_5).Replace("{toPage}", string.Concat(int_0)).Replace("{type}", string_3).Replace("{schCond}", string_6), string_7, out string_8);
	}
	public static string smethod_2(string string_3, string string_4, string string_5, string string_6)
	{
		string newValue = StringUtil.subString(string_6, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/urltrans/urltrans.json?siteid={siteid}&adzoneid={adzoneid}&promotionURL={promotionURL}&t={t}&pvid={pvid}&_tb_token_={_tb_token_}&_input_charset=utf-8";
		string address = text.Replace("{siteid}", string_3).Replace("{adzoneid}", string_4).Replace("{promotionURL}", HttpUtility.UrlEncode(string_5)).Replace("{t}", string.Concat(AlimamaUtil.current_time())).Replace("{pvid}", AlimamaUtil.query_pvid(string_6)).Replace("{_tb_token_}", newValue);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7900221.a214tr8.4.tS8Am0");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_6);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text2;
		if ("gzip".Equals(value))
		{
			text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text2 = Encoding.UTF8.GetString(array);
		}
		return StringUtil.subString(text2, 0, "\"shortLinkUrl\":\"", "\"");
	}
	public static ArrayList smethod_20(string string_3, string string_4, out string string_5)
	{
		string newValue = StringUtil.subString(string_4, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/pubauc/searchAuctionList.json?q=https%3A%2F%2Fitem.taobao.com%2Fitem.htm%3Fid%3D{itemid}&toPage=1&perPagesize=40&t={timestamp}&_tb_token_={tbToken}&_input_charset=utf-8";
		return AlimamaUtil.smethod_21(text.Replace("{itemid}", string_3).Replace("{tbToken}", newValue).Replace("{timestamp}", string.Concat(AlimamaUtil.current_time())), string_4, out string_5);
	}
	public static ArrayList smethod_21(string string_3, string string_4, out string string_5)
	{
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_4);
		string text = "";
		byte[] array = webClient.DownloadData(string_3);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		if ("gzip".Equals(value))
		{
			text = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		if (text.IndexOf("\"length\":0") != -1)
		{
			string_5 = "";
			return arrayList;
		}
		string value2 = "\"" + StringUtil.subString(text, 0, "\"pagelist\":[{\"", "\"") + "\"";
		int num = 0;
		while (true)
		{
			num = text.IndexOf(value2, num);
			if (num == -1)
			{
				break;
			}
			GoodsItem5 goodsItem = new GoodsItem5();
			goodsItem.user_num_id = StringUtil.subString(text, num, "\"userNumberId\":\"", "\"");
			if ("".Equals(goodsItem.user_num_id))
			{
				goodsItem.user_num_id = StringUtil.subString(text, num, "\"userNumberId\":", ",");
			}
			goodsItem.title = GzipUtil.html_to_text(StringUtil.subString(text, num, "\"title\":\"", "\","));
			goodsItem.pic_url = GzipUtil.html_to_text(StringUtil.subString(text, num, "\"pictUrl\":\"", "\","));
			goodsItem.price = StringUtil.subString(text, num, "\"zkPrice\":", ",");
			goodsItem.ori_price = StringUtil.subString(text, num, "\"reservePrice\":", ",");
			goodsItem.user_type = StringUtil.subString(text, num, "\"userType\":", ",");
			goodsItem.nick = StringUtil.subString(text, num, "\"nick\":\"", "\"");
			goodsItem.num_iid = StringUtil.subString(text, num, "\"auctionId\":\"", "\"");
			if ("".Equals(goodsItem.num_iid))
			{
				goodsItem.num_iid = StringUtil.subString(text, num, "\"auctionId\":", ",");
			}
			goodsItem.commissionRatePercent = StringUtil.subString(text, num, "\"commissionRatePercent\":", ",");
			try
			{
				goodsItem.volume = int.Parse(StringUtil.subString(text, num, "\"totalNum\":", ","));
			}
			catch
			{
			}
			arrayList.Add(goodsItem);
			num++;
		}
		if (arrayList.Count == 0)
		{
			string_5 = text;
		}
		else
		{
			string_5 = "";
		}
		return arrayList;
	}
	public static ArrayList smethod_22(string string_3, string string_4)
	{
		string newValue = StringUtil.subString(string_4, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/shopdetail/shopinfo.json?oriMemberId={memberId}&_tb_token_={tbToken}&_input_charset=utf-8";
		string address = text.Replace("{shopid}", string_3).Replace("{tbToken}", newValue);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.OaHsHE");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_4);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text2;
		if ("gzip".Equals(value))
		{
			text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text2 = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		int num = 0;
		while ((num = text2.IndexOf("\"memberID\"", num)) != -1)
		{
			arrayList.Add(new Store
			{
				member_id = StringUtil.subString(text2, num, "\"memberID\":", ","),
				ori_member_id = StringUtil.subString(text2, num, "\"oriMemberId\":", ","),
				shop_url = StringUtil.subString(text2, num, "\"shopUrl\":\"", "\""),
				title = StringUtil.subString(text2, num, "\"shopTitle\":\"", "\""),
				avg_commission = float.Parse(StringUtil.subString(text2, num, "\"shopCommissionRate\":", ",")) / 100f
			});
			num++;
		}
		return arrayList;
	}
	public static ArrayList smethod_23(string string_3, string string_4)
	{
		return AlimamaUtil.smethod_26("", string_3, string_4);
	}
	public static ArrayList smethod_24(string string_3, string string_4)
	{
		return AlimamaUtil.smethod_26("&shopType=2", string_3, string_4);
	}
	public static ArrayList smethod_25(string string_3, string string_4)
	{
		return AlimamaUtil.smethod_26("&shopType=1", string_3, string_4);
	}
	public static ArrayList smethod_26(string string_3, string string_4, string string_5)
	{
		string format = "http://pub.alimama.com/shopsearch/shopList.json?spm=a219t.7473494.1998155389.3.2x0qLl&q={0}{1}&toPage=1&sort=_totalAction&perPagesize=40";
		string address = string.Format(format, HttpUtility.UrlEncode(string_4), string_3);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_5);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text;
		if ("gzip".Equals(value))
		{
			text = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		int num = 0;
		while ((num = text.IndexOf("\"memberID\"", num)) != -1)
		{
			arrayList.Add(new Store
			{
				member_id = StringUtil.subString(text, num, "\"memberID\":", ","),
				ori_member_id = StringUtil.subString(text, num, "\"oriMemberId\":", ","),
				shop_url = StringUtil.subString(text, num, "\"shopUrl\":\"", "\""),
				title = StringUtil.subString(text, num, "\"shopTitle\":\"", "\""),
				avg_commission = float.Parse(StringUtil.subString(text, num, "\"shopCommissionRate\":", ",")) / 100f
			});
			num++;
		}
		return arrayList;
	}
	public static string smethod_27(string string_3, string string_4, string string_5, string string_6)
	{
		string text = StringUtil.subString(string_6, 0, "_tb_token_=", ";");
		string format = "http://pub.alimama.com/common/code/getShopCode.json?orimemberid={0}&adzoneid={1}&siteid={2}&_tb_token_={3}&_input_charset=utf-8";
		string address = string.Format(format, new object[]
		{
			string_3,
			string_4,
			string_5,
			text
		});
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_6);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text2;
		if ("gzip".Equals(value))
		{
			text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text2 = Encoding.UTF8.GetString(array);
		}
		string result = "";
		try
		{
			int num = text2.IndexOf("clickUrl") + 11;
			int length = text2.IndexOf("pid") - num - 3;
			result = text2.Substring(num, length);
		}
		catch
		{
		}
		return result;
	}
	public static string query_pvid(string taoke_cookie)
	{
		string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", taoke_cookie);
		string text = "http://pub.alimama.com/items/channel/qqhd.json?q=https://item.taobao.com/item.htm?id=52742091987&channel=qqhd&perPageSize=50&shopTag=&_tb_token_={token}";
		text = text.Replace("{token}", newValue);
		byte[] array = webClient.DownloadData(text);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text2;
		if ("gzip".Equals(value))
		{
			text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text2 = Encoding.UTF8.GetString(array);
		}
		return StringUtil.subString(text2, 0, "\"message\":null,\"pvid\":\"", "\"");
	}
	public static string query_taoke_item_click(string num_iid, string adzoneid, string siteid, string taoke_cookie)
	{
		string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/common/code/getAuctionCode.json?auctionid={auctionid}&adzoneid={adzoneid}&siteid={siteid}&t={t}&pvid={pvid}&_tb_token_={token}&_input_charset=utf-8";
		string address = text.Replace("{auctionid}", num_iid).Replace("{adzoneid}", adzoneid).Replace("{siteid}", siteid).Replace("{t}", string.Concat(AlimamaUtil.current_time())).Replace("{pvid}", AlimamaUtil.query_pvid(taoke_cookie)).Replace("{token}", newValue);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", taoke_cookie);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		if ("gzip".Equals(value))
		{
			return GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		return Encoding.UTF8.GetString(array);
	}
	public static ArrayList smethod_3(string string_3)
	{
		string newValue = StringUtil.subString(string_3, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/common/site/generalize/guideList.json?t={timestamp}&pvid=&_tb_token_={_tb_token_}&_input_charset=utf-8";
		text = text.Replace("{timestamp}", string.Concat(AlimamaUtil.current_time())).Replace("{_tb_token_}", newValue);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_3);
		byte[] array = webClient.DownloadData(text);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text2;
		if ("gzip".Equals(value))
		{
			text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text2 = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		string value2 = "\"" + StringUtil.subString(text2, 0, "\"guideList\":[{\"", "\"") + "\"";
		int num = 0;
		while ((num = text2.IndexOf(value2, num)) != -1)
		{
			arrayList.Add(new GuideItem
			{
				string_0 = StringUtil.subString(text2, num, "\"name\":\"", "\""),
				string_1 = StringUtil.subString(text2, num, "\"memberID\":", ","),
				string_2 = StringUtil.subString(text2, num, "\"guideID\":", ","),
				string_3 = StringUtil.subString(text2, num, "\"siteType\":\"", "\""),
				string_4 = StringUtil.subString(text2, num, "\"category2\":\"", "\""),
				string_5 = StringUtil.subString(text2, num, "\"category3\":\"", "\""),
				string_6 = StringUtil.subString(text2, num, "\"account1\":[", "\"]") + "\"",
				string_7 = StringUtil.subString(text2, num, "\"account2\":[", "\"]") + "\"",
				string_8 = StringUtil.subString(text2, num, "\"account3\":[", "\"]") + "\""
			});
			num++;
		}
		return arrayList;
	}
	public static string smethod_30(string string_3)
	{
		return StringUtil.subString(string_3, 0, "\"clickUrl\":\"", "\"");
	}
	public static string smethod_31(string string_3)
	{
		return StringUtil.subString(string_3, 0, "\"shortLinkUrl\":\"", "\"");
	}
	public static string smethod_32(string string_3)
	{
		return StringUtil.subString(string_3, 0, "\"eliteUrl\":\"", "\"");
	}
	public static ArrayList smethod_33(string string_3)
	{
		ArrayList arrayList = new ArrayList();
		int num = 1;
		bool flag = true;
		while (flag)
		{
			ArrayList c = AlimamaUtil.smethod_34(num, out flag, string_3);
			arrayList.AddRange(c);
			num++;
			Thread.Sleep(10);
		}
		return arrayList;
	}
	public static ArrayList smethod_34(int int_0, out bool bool_0, string string_3)
	{
		string newValue = StringUtil.subString(string_3, 0, "_tb_token_=", ";");
		ArrayList arrayList = new ArrayList();
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_3);
		string address = AlimamaUtil.string_0.Replace("{pageno}", string.Concat(int_0)).Replace("{tbtoken}", newValue);
		string text = GzipUtil.zip_to_string(webClient.DownloadData(address), Encoding.UTF8);
		int num = int.Parse(StringUtil.subString(text, 0, "\"totalPages\":", ","));
		if (int_0 >= num)
		{
			bool_0 = false;
		}
		else
		{
			bool_0 = true;
		}
		int num2 = 0;
		while ((num2 = text.IndexOf("\"protocol\"", num2)) != -1)
		{
			arrayList.Add(new EventItem
			{
				event_id = StringUtil.subString(text, num2, "\"eventId\":", ","),
				start_time = int.Parse(StringUtil.subString(text, num2, "\"startTime\":\"", "\",").Replace("-", "")),
				end_time = int.Parse(StringUtil.subString(text, num2, "\"endTime\":\"", "\",").Replace("-", "")),
				avg_commission = double.Parse(StringUtil.subString(text, num2, "\"avgCommission\":\"", "\",")),
				share_rate = double.Parse(StringUtil.subString(text, num2, "\"shareRate\":\"", "\","))
			});
			num2++;
		}
		return arrayList;
	}
	public static ArrayList smethod_35(string string_3, string string_4)
	{
		string newValue = StringUtil.subString(string_4, 0, "_tb_token_=", ";");
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_4);
		ArrayList arrayList = new ArrayList();
		string address = AlimamaUtil.string_1.Replace("{brdgId}", string_3).Replace("{tbtoken}", newValue);
		string text = GzipUtil.zip_to_string(webClient.DownloadData(address), Encoding.UTF8);
		int num = 0;
		while ((num = text.IndexOf("\"protocol\"", num)) != -1)
		{
			arrayList.Add(new EventItem
			{
				event_id = StringUtil.subString(text, num, "\"eventId\":", ","),
				start_time = int.Parse(StringUtil.subString(text, num, "\"startTime\":\"", "\",").Replace("-", "")),
				end_time = int.Parse(StringUtil.subString(text, num, "\"endTime\":\"", "\",").Replace("-", "")),
				avg_commission = AlimamaUtil.smethod_36(StringUtil.subString(text, num, "\"catRule\":\"", "\",")),
				share_rate = double.Parse(StringUtil.subString(text, num, "\"shareRate\":\"", "\","))
			});
			num++;
		}
		return arrayList;
	}
	public static double smethod_36(string string_3)
	{
		int num = 0;
		double num2 = 0.0;
		int num3 = 0;
		while ((num3 = string_3.IndexOf("≥", num3)) != -1)
		{
			num2 += double.Parse(StringUtil.subString(string_3, num3, "≥", "%"));
			num++;
			num3++;
		}
		return num2 / (double)num;
	}
	public static ArrayList smethod_37(string event_id, string string_4, string string_5, out string string_6)
	{
		WebClient webClient = new WebClient();
		string_6 = "";
		ArrayList arrayList = new ArrayList();
		int num = 1;
		while (true)
		{
			webClient.Headers.Clear();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://temai.taobao.com/event" + event_id + ".htm");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_5);
			string address = AlimamaUtil.string_2.Replace("{brdgId}", event_id ?? "").Replace("{pid}", string_4).Replace("{pageno}", string.Concat(num)).Replace("{t}", string.Concat(AlimamaUtil.current_time())).Replace("{pvid}", AlimamaUtil.query_pvid(string_5));
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text;
			if (!"gzip".Equals(value))
			{
				text = Encoding.UTF8.GetString(array);
			}
			else
			{
				text = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			if (text.Contains("\"result\":[]"))
			{
				break;
			}
			string_6 = (string_6.Equals("") ? text : (string_6 + "\n" + text));
			int num2 = 0;
			while ((num2 = text.IndexOf("\"itemId\":", num2)) != -1)
			{
				EventGoods eventGoods = new EventGoods();
				eventGoods.event_id = event_id;
				eventGoods.num_iid = StringUtil.subString(text, num2, "\"itemId\":", ",");
				eventGoods.title = StringUtil.subString(text, num2, "\"itemTitle\":\"", ",\"");
				eventGoods.title = eventGoods.title.Substring(0, eventGoods.title.Length - 1);
				eventGoods.url = "http:" + StringUtil.subString(text, num2, "\"href\":\"", "\",");
				eventGoods.user_num_id = StringUtil.subString(text, num2, "\"sellerId\":", ",");
				eventGoods.pic_url = "http:" + StringUtil.subString(text, num2, "\"picUrl\":\"", "\",");
				eventGoods.commission_rate = double.Parse(StringUtil.subString(text, num2, "\"commissionRate\":", ",")) / 100.0;
				eventGoods.is_sold_out = (bool.Parse(StringUtil.subString(text, num2, "\"isSoldOut\":", ",")) ? 1 : 0);
				eventGoods.price = double.Parse(StringUtil.subString(text, num2, "\"discountPrice\":\"", "\","));
				eventGoods.ori_price = StringUtil.subString(text, num2, "\"auctionPrice\":\"", "\",");
				eventGoods.discount_rate = StringUtil.subString(text, num2, "\"discountRate\":\"", "\",");
				if (eventGoods.discount_rate.Equals(""))
				{
					eventGoods.discount_rate = "0";
				}
				eventGoods.volume = int.Parse(StringUtil.subString(text, num2, "\"soldQuantity\":", ","));
				eventGoods.is_mall = (bool.Parse(StringUtil.subString(text, num2, "\"mall\":", "}")) ? 1 : 0);
				arrayList.Add(eventGoods);
				num2++;
			}
			string value2 = StringUtil.subString(text, 0, "\"hasNext\":", ",");
			string value3 = StringUtil.subString(text, 0, "\"nextPage\":", ",");
			if ("0".Equals(value2) && string.Concat(num).Equals(value3))
			{
				return arrayList;
			}
			num++;
		}
		return arrayList;
	}
	public static ArrayList smethod_38(int int_0, string string_3, out string string_4)
	{
		ArrayList result;
		try
		{
			string newValue = StringUtil.subString(string_3, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Clear();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.4Qcyc0");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_3);
			string text = "http://pub.alimama.com/campaign/joinedCampaigns.json?toPage={pageNo}&perPageSize=40&_tb_token_={tbtoken}&_input_charset=utf-8";
			string address = text.Replace("{pageNo}", string.Concat(int_0)).Replace("{tbtoken}", newValue);
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string string_5;
			if ("gzip".Equals(value))
			{
				string_5 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				string_5 = Encoding.UTF8.GetString(array);
			}
			ArrayList arrayList = AlimamaUtil.smethod_40(string_5);
			string_4 = "";
			result = arrayList;
		}
		catch (Exception ex)
		{
			string_4 = "出错啦！！！" + ex.ToString();
			result = new ArrayList();
		}
		return result;
	}
	public static ArrayList smethod_39(string string_3, string string_4, out string string_5)
	{
		ArrayList result;
		try
		{
			string newValue = StringUtil.subString(string_4, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Clear();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.4Qcyc0");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_4);
			string text = "http://pub.alimama.com/campaign/joinedCampaigns.json?toPage=1&nickname={nickname}&perPageSize=40&_tb_token_={tbtoken}&_input_charset=utf-8";
			string address = text.Replace("{nickname}", HttpUtility.UrlEncode(string_3)).Replace("{tbtoken}", newValue);
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string string_6;
			if ("gzip".Equals(value))
			{
				string_6 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				string_6 = Encoding.UTF8.GetString(array);
			}
			ArrayList arrayList = AlimamaUtil.smethod_40(string_6);
			string_5 = "";
			result = arrayList;
		}
		catch (Exception ex)
		{
			string_5 = "出错啦！！！" + ex.ToString();
			result = new ArrayList();
		}
		return result;
	}
	public static string query_member_id(string taoke_cookie)
	{
		string address = "http://pub.alimama.com/common/getUnionPubContextInfo.json";
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", taoke_cookie);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text;
		if ("gzip".Equals(value))
		{
			text = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text = Encoding.UTF8.GetString(array);
		}
		return StringUtil.subString(text, 0, "\"memberid\":", ",");
	}
	public static ArrayList smethod_40(string string_3)
	{
		ArrayList arrayList = new ArrayList();
		string value = "\"" + StringUtil.subString(string_3, 0, "\"pagelist\":[{\"", "\"") + "\"";
		int num = 0;
		while ((num = string_3.IndexOf(value, num)) != -1)
		{
			CampaignBean campaignBean = new CampaignBean();
			int num2 = string_3.IndexOf("\"id\"", num + 1);
			int length = string_3.Length - num;
			if (num2 != -1)
			{
				length = num2 - num;
			}
			string text = string_3.Substring(num, length);
			campaignBean.id = StringUtil.subString(text, 0, "\"id\":", ",");
			campaignBean.campaign_id = StringUtil.subString(text, 0, "\"campaignId\":", ",");
			campaignBean.shop_keeper_id = StringUtil.subString(text, 0, "\"shopKeeperId\":", ",");
			campaignBean.user_num_id = StringUtil.subString(text, 0, "\"oriMemberId\":", ",");
			campaignBean.campaign_name = StringUtil.subString(text, 0, "\"campaignName\":\"", "\",");
			campaignBean.status = StringUtil.subString(text, 0, "\"status\":", ",");
			campaignBean.campaign_type = StringUtil.subString(text, 0, "\"campaignType\":", ",");
			campaignBean.invalide_campaign = bool.Parse(StringUtil.subString(text, 0, "\"invalideCampaign\":", ","));
			campaignBean.campaign_status = StringUtil.subString(text, 0, "\"campaignStatus\":", ",");
			if ("null".Equals(campaignBean.campaign_type))
			{
				campaignBean.campaign_type = "";
			}
			arrayList.Add(campaignBean);
			num++;
		}
		return arrayList;
	}
	public static ArrayList smethod_41(string string_3, string string_4, out string string_5)
	{
		ArrayList result;
		try
		{
			string newValue = StringUtil.subString(string_4, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Clear();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.4Qcyc0");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_4);
			string text = "http://pub.alimama.com/shopdetail/campaigns.json?oriMemberId={oriMemberid}&t={timestamp}&_tb_token_={tbtoken}&_input_charset=utf-8";
			string address = text.Replace("{oriMemberid}", string_3).Replace("{timestamp}", string.Concat(AlimamaUtil.current_time())).Replace("{tbtoken}", newValue);
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string string_6;
			if ("gzip".Equals(value))
			{
				string_6 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				string_6 = Encoding.UTF8.GetString(array);
			}
			ArrayList arrayList = AlimamaUtil.smethod_46(string_6, string_3, string_4);
			string_5 = "";
			result = arrayList;
		}
		catch (Exception ex)
		{
			string_5 = "出错啦！！！" + ex.ToString();
			result = new ArrayList();
		}
		return result;
	}
	public static bool apply_campaign(string campid, string keeperid, string applyreason_pre, string applyreason, string taoke_cookie, out string out_log)
	{
		bool result;
		try
		{
			out_log = "";
			string text = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("Origin", "http://pub.alimama.com");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", taoke_cookie);
			string s = string.Concat(new string[]
			{
				"campId=",
				campid,
				"&keeperid=",
				keeperid,
				"&applyreason=",
				HttpUtility.UrlEncode(applyreason_pre + applyreason),
				"&_tb_token_=",
				text
			});
			byte[] array = webClient.UploadData("http://pub.alimama.com/pubauc/applyForCommonCampaign.json", "POST", Encoding.UTF8.GetBytes(s));
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			if (text2.Contains("\"message\":null") && text2.Contains("\"ok\":true"))
			{
				out_log = "申请高佣金计划【成功】！高佣金计划ID：【" + campid + "】";
				result = true;
			}
			else
			{
				string text3 = StringUtil.subString(text2, 0, "\"message\":\"", "\"");
				if (string.IsNullOrEmpty(text3))
				{
					out_log = string.Concat(new string[]
					{
						"申请高佣金计划【失败】！高佣金计划ID：【",
						campid,
						"】，失败原因：【",
						text2,
						"】。"
					});
				}
				else
				{
					out_log = string.Concat(new string[]
					{
						"申请高佣金计划【失败】！高佣金计划ID：【",
						campid,
						"】，失败原因：【",
						text3,
						"】。"
					});
				}
				result = false;
			}
		}
		catch (Exception ex)
		{
			out_log = "出错啦！！！" + ex.ToString();
			result = false;
		}
		return result;
	}
	public static void smethod_43(string campain_id, string cookie, out string out_log)
	{
		try
		{
			string newValue = StringUtil.subString(cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("Origin", "http://pub.alimama.com");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.jLGE9b");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", cookie);
			string address = "http://pub.alimama.com/campaign/exitCampaign.json";
			string s = "pubCampaignid={cmpid}&_tb_token_={token}".Replace("{cmpid}", campain_id).Replace("{token}", newValue);
			byte[] array = webClient.UploadData(address, "POST", Encoding.UTF8.GetBytes(s));
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text;
			if ("gzip".Equals(value))
			{
				text = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text = Encoding.UTF8.GetString(array);
			}
			if (text.Contains("\"message\":null") && text.Contains("\"ok\":true"))
			{
				out_log = "退出高佣金计划【成功】！高佣金计划ID：【" + campain_id + "】";
			}
			else
			{
				string text2 = StringUtil.subString(text, 0, "\"message\":\"", "\"");
				out_log = string.Concat(new string[]
				{
					"退出高佣金计划【失败】！高佣金计划ID：【",
					campain_id,
					"】，失败原因：【",
					text2,
					"】"
				});
			}
		}
		catch (Exception ex)
		{
			out_log = "出错啦！！！" + ex.ToString();
		}
	}
	public static void smethod_44(string string_3, string string_4, string string_5, out string string_6)
	{
		AlimamaUtil.query_campain_detail(string_3, string_4, false, string_5, out string_6);
	}
	public static void query_campain_detail(string user_num_id, string applyreason, bool bool_0, string cookie, out string out_log)
	{
		try
		{
			out_log = "";
			string text = StringUtil.subString(cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", cookie);
			string text2 = "http://pub.alimama.com/shopdetail/campaigns.json?oriMemberId={oriMemberid}&&_tb_token_={tbtoken}&_input_charset=utf-8";
			string address = text2.Replace("{oriMemberid}", user_num_id).Replace("{tbtoken}", text);
			string text3 = "";
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			if ("gzip".Equals(value))
			{
				text3 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text3 = Encoding.UTF8.GetString(array);
			}
			CampaignBean campaignBean = null;
			double num = 0.0;
			int num2 = 0;
			ArrayList arrayList = new ArrayList();
			while ((num2 = text3.IndexOf("\"campaignName\":\"", num2)) != -1)
			{
				CampaignBean campaignBean2 = new CampaignBean();
				campaignBean2.campaign_name = StringUtil.subString(text3, num2, "\"campaignName\":\"", "\",");
				try
				{
					campaignBean2.avg_commission = (double)(float.Parse(StringUtil.subString(text3, num2, "\"avgCommission\":", ",")) / 100f);
					goto IL_1F0;
				}
				catch
				{
					campaignBean2.avg_commission = 0.0;
					goto IL_1F0;
				}
				goto IL_1BB;
				IL_1C4:
				arrayList.Add(campaignBean2);
				if ("通用计划".Equals(campaignBean2.campaign_name))
				{
					campaignBean = campaignBean2;
				}
				num2++;
				continue;
				IL_1BB:
				num = campaignBean2.avg_commission;
				goto IL_1C4;
				IL_1F0:
				if (num >= campaignBean2.avg_commission)
				{
					goto IL_1C4;
				}
				goto IL_1BB;
			}
			if (arrayList.Count == 0)
			{
				out_log = "【" + user_num_id + "】，该店铺没有淘客佣金！";
			}
			else
			{
				if (arrayList.Count == 1)
				{
					out_log = "【" + user_num_id + "】，该店铺没有高佣金计划，不需要申请！";
				}
				else
				{
					if (num <= campaignBean.avg_commission)
					{
						out_log = "【" + user_num_id + "】，该店铺的【通用计划】佣金最高，不需要申请！";
					}
					else
					{
						ArrayList arrayList2 = AlimamaUtil.smethod_46(text3, user_num_id, cookie);
						if (AlimamaUtil.smethod_52(arrayList2))
						{
							if (bool_0)
							{
								IEnumerator enumerator = arrayList2.GetEnumerator();
								try
								{
									while (enumerator.MoveNext())
									{
										CampaignBean campaignBean3 = (CampaignBean)enumerator.Current;
										if (campaignBean3.string_7.Equals("true"))
										{
											string text4 = "";
											AlimamaUtil.smethod_43(campaignBean3.id, cookie, out text4);
											out_log = (out_log.Equals("") ? text4 : (out_log + "\n" + text4));
										}
									}
									goto IL_31F;
								}
								finally
								{
									IDisposable disposable = enumerator as IDisposable;
									if (disposable != null)
									{
										disposable.Dispose();
									}
								}
							}
							out_log = "【" + user_num_id + "】，已经申请该店铺的高佣金计划！";
							return;
						}
						IL_31F:
						Thread.Sleep(50);
						webClient.Headers.Clear();
						webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
						webClient.Headers.Add("Origin", "http://pub.alimama.com");
						webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
						webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
						webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
						webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
						webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
						webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
						webClient.Headers.Add("Cookie", cookie);
						CampaignBean campaignBean4 = (CampaignBean)arrayList2[0];
						string campaign_id = campaignBean4.campaign_id;
						string shop_keeper_id = campaignBean4.shop_keeper_id;
						string s = string.Concat(new string[]
						{
							"campId=",
							campaign_id,
							"&keeperid=",
							shop_keeper_id,
							"&applyreason=",
							HttpUtility.UrlEncode(applyreason),
							"&_tb_token_=",
							text
						});
						byte[] bytes = webClient.UploadData("http://pub.alimama.com/pubauc/applyForCommonCampaign.json", "POST", Encoding.UTF8.GetBytes(s));
						string @string = Encoding.UTF8.GetString(bytes);
						if (@string.Contains("\"message\":null") && @string.Contains("\"ok\":true"))
						{
							string text4 = string.Concat(new object[]
							{
								"【",
								user_num_id,
								"】，申请高佣金计划【成功】！高佣金计划：【",
								campaignBean4.campaign_name,
								"】，平均佣金：【",
								campaignBean4.avg_commission,
								"】"
							});
							out_log = (out_log.Equals("") ? text4 : (out_log + "\n" + text4));
						}
						else
						{
							string text5 = StringUtil.subString(@string, 0, "\"message\":\"", "\"");
							string text4 = string.Concat(new string[]
							{
								"【",
								user_num_id,
								"】，申请高佣金计划【失败】！高佣金计划：【",
								campaignBean4.campaign_name,
								"】，失败原因：【",
								text5,
								"】"
							});
							out_log = (out_log.Equals("") ? text4 : (out_log + "\n" + text4));
						}
					}
				}
			}
		}
		catch (Exception ex)
		{
			out_log = "出错啦！！！" + ex.ToString();
		}
	}
	public static ArrayList smethod_46(string string_3, string string_4, string string_5)
	{
		string text = "";
		AlimamaUtil.smethod_14(string_4, string_5, out text);
		ArrayList arrayList = new ArrayList();
		int num = string_3.IndexOf("exsitApplyList");
		if (num != -1)
		{
			int length = string_3.IndexOf("campaignList") - num;
			string text2 = string_3.Substring(num, length);
			int num2 = 0;
			while ((num2 = text2.IndexOf("\"id\":", num2)) != -1)
			{
				CampaignBean campaignBean = new CampaignBean();
				int length2 = text2.IndexOf("}", num2) - num2;
				string text3 = string_3.Substring(num2, length2);
				campaignBean.id = StringUtil.subString(text3, 0, "\"id\":", ",");
				campaignBean.campaign_id = StringUtil.subString(text3, 0, "\"campaignId\":", ",");
				campaignBean.status = StringUtil.subString(text3, 0, "\"status\":", ",");
				campaignBean.string_10 = StringUtil.subString(text3, 0, "\"refuseComments\":\"", "\",");
				arrayList.Add(campaignBean);
				num2++;
			}
		}
		ArrayList arrayList2 = new ArrayList();
		string text4 = string_3.Substring(string_3.IndexOf("campaignList"));
		int num3 = 0;
		IL_111:
		while ((num3 = text4.IndexOf("properties", num3)) != -1)
		{
			CampaignBean campaignBean = new CampaignBean();
			int num4 = text4.IndexOf("properties", num3 + 1);
			int length2 = text4.Length - num3;
			if (num4 != -1)
			{
				length2 = num4 - num3;
			}
			string text3 = text4.Substring(num3, length2);
			campaignBean.campaign_id = StringUtil.subString(text3, 0, "\"campaignId\":", ",");
			campaignBean.campaign_name = StringUtil.subString(text3, 0, "\"campaignName\":\"", "\",");
			campaignBean.campaign_type = StringUtil.subString(text3, 0, "\"campaignType\":", ",");
			string s = StringUtil.subString(text3, 0, "\"avgCommissionToString\":\"", "\",").Replace("%", "").Replace(" ", "");
			try
			{
				campaignBean.avg_commission = (double)float.Parse(s);
			}
			catch
			{
			}
			campaignBean.string_11 = StringUtil.subString(text3, 0, "\"campaignComments\":\"", "\",");
			IEnumerator enumerator = arrayList.GetEnumerator();
			while (enumerator.MoveNext())
			{
				CampaignBean campaignBean2 = (CampaignBean)enumerator.Current;
				if (campaignBean2.campaign_id.Equals(campaignBean.campaign_id))
				{
					campaignBean.id = campaignBean2.id;
					campaignBean.string_7 = "true";
					campaignBean.status = campaignBean2.status;
					campaignBean.string_10 = campaignBean2.string_10;
					IL_2F2:
					campaignBean.shop_keeper_id = StringUtil.subString(text3, 0, "\"shopKeeperId\":", ",");
					campaignBean.user_num_id = string_4;
					campaignBean.string_9 = StringUtil.subString(text3, 0, "properties\":", ",");
					arrayList2.Add(campaignBean);
					num3++;
					goto IL_111;
				}
			}
			//goto IL_2F2;
		}
		for (int i = 0; i < arrayList2.Count - 1; i++)
		{
			for (int j = i; j < arrayList2.Count; j++)
			{
				if (((CampaignBean)arrayList2[i]).avg_commission < ((CampaignBean)arrayList2[j]).avg_commission)
				{
					CampaignBean value = (CampaignBean)arrayList2[i];
					arrayList2[i] = arrayList2[j];
					arrayList2[j] = value;
				}
			}
		}
		return arrayList2;
	}
	public static CampaignItem query_campain_detail(string cookie, string campaign_id, string sho_keeper_id, out string out_log)
	{
		CampaignItem result;
		try
		{
			out_log = "";
			string newValue = StringUtil.subString(cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", cookie);
			string text = "http://pub.alimama.com/campaign/campaignDetail.json?campaignId={campaignId}&shopkeeperId={shopkeeperId}&_tb_token_={tbtoken}&_input_charset=utf-8";
			string address = text.Replace("{campaignId}", campaign_id).Replace("{shopkeeperId}", sho_keeper_id).Replace("{tbtoken}", newValue);
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			if (text2.Contains("nologin"))
			{
				out_log = "";
				result = null;
			}
			else
			{
				result = new CampaignItem
				{
					campaignComments = StringUtil.subString(text2, 0, "\"campaignComments\":\"", "\","),
					campaign_name = StringUtil.subString(text2, 0, "\"campaignName\":\"", "\","),
					string_2 = StringUtil.subString(text2, 0, "\"campaignComments\":\"", "\","),
					status = StringUtil.subString(text2, 0, "\"status\":", ",")
				};
			}
		}
		catch (Exception ex)
		{
			out_log = "出错啦！！！" + ex.ToString();
			result = null;
		}
		return result;
	}
	public static ArrayList smethod_48(string taoke_cookie, string campaignId, string shopkeeperId, string userNumberId, out string string_7)
	{
		ArrayList result;
		try
		{
			string_7 = "";
			string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			ArrayList arrayList = new ArrayList();
			int num = 1;
			while (true)
			{
				webClient.Headers.Clear();
				webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
				webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
				webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
				webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
				webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.aMV6Mc");
				webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
				webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
				webClient.Headers.Add("Cookie", taoke_cookie);
				string text = "http://pub.alimama.com/campaign/merchandiseDetail.json?spm=a219t.7473494.1998155389.3.aMV6Mc&campaignId={campaignId}&shopkeeperId={shopkeeperId}&userNumberId={userNumberId}&tab=2&omid={userNumberId}&toPage={pageNo}&perPagesize=10&_tb_token_={tbtoken}&_input_charset=utf-8";
				string address = text.Replace("{pageNo}", string.Concat(num)).Replace("{campaignId}", campaignId).Replace("{shopkeeperId}", shopkeeperId).Replace("{userNumberId}", userNumberId).Replace("{tbtoken}", newValue);
				string text2 = "";
				byte[] array = webClient.DownloadData(address);
				string value = webClient.ResponseHeaders["Content-Encoding"];
				if (!"gzip".Equals(value))
				{
					text2 = Encoding.UTF8.GetString(array);
				}
				else
				{
					text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
				}
				string value2 = StringUtil.subString(text2, 0, "\"pagelist\":[{", "\\:");
				int num2 = 0;
				while ((num2 = text2.IndexOf(value2, num2)) != -1)
				{
					GoodsItem5 goodsItem = new GoodsItem5();
					goodsItem.user_type = StringUtil.subString(text2, num2, "\"userType\":", ",");
					goodsItem.user_num_id = StringUtil.subString(text2, num2, "\"userNumberId\":", ",");
					goodsItem.num_iid = StringUtil.subString(text2, num2, "\"auctionId\":", ",");
					goodsItem.title = StringUtil.subString(text2, num2, "\"title\":\"", "\",");
					goodsItem.pic_url = StringUtil.subString(text2, num2, "\"pictUrl\":\"", "\",");
					goodsItem.price = StringUtil.subString(text2, num2, "\"zkPrice\":", ",");
					goodsItem.ori_price = StringUtil.subString(text2, num2, "\"reservePrice\":", ",");
					try
					{
						goodsItem.volume = int.Parse(StringUtil.subString(text2, num2, "\"totalNum\":", ","));
						goto IL_2C0;
					}
					catch
					{
						goodsItem.volume = 0;
						goto IL_2C0;
					}
					break;
					IL_2C0:
					goodsItem.commissionRatePercent = StringUtil.subString(text2, num2, "\"commissionRatePercent\":", ",");
					goodsItem.nick = StringUtil.subString(text2, num2, "\"nick\":\"", "\",");
					arrayList.Add(goodsItem);
					num2++;
				}
				int num3 = int.Parse(StringUtil.subString(text2, 0, "\"pages\":", ","));
				if (num >= num3)
				{
					break;
				}
				Thread.Sleep(10);
				num++;
			}
			result = arrayList;
		}
		catch (Exception ex)
		{
			string_7 = "出错啦！！！" + ex.ToString();
			result = new ArrayList();
		}
		return result;
	}
	public static GoodsItem5 smethod_49(string string_3, string string_4, string string_5, string string_6, string string_7, out string string_8)
	{
		return AlimamaUtil.smethod_50(string_3, string_4, string_5, string_6, string_7, 3, out string_8);
	}
	public static AdzoneBean query_AdzoneBean(string tag, string cookie)
	{
		string newValue = StringUtil.subString(cookie, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/common/adzone/newSelfAdzone2.json?tag={tag}&_tb_token_={_tb_token_}&_input_charset=utf-8";
		string address = text.Replace("{_tb_token_}", newValue).Replace("{tag}", tag);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", cookie);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string body;
		if ("gzip".Equals(value))
		{
			body = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			body = Encoding.UTF8.GetString(array);
		}
		return new AdzoneBean
		{
			memberid = AlimamaUtil.query_member_id(cookie),
			otherAdzones_List = AlimamaUtil.parse_Adzone(body, 3),
			appAdzones_List = AlimamaUtil.parse_Adzone(body, 2),
			webAdzones_List = AlimamaUtil.parse_Adzone(body, 1)
		};
	}
	public static GoodsItem5 smethod_50(string taoke_cookie, string num_iid, string campaignId, string shopkeeperId, string userNumberId, int int_0, out string string_8)
	{
		GoodsItem5 result;
		try
		{
			string_8 = "";
			string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			new ArrayList();
			int num = 1;
			GoodsItem5 goodsItem;
			while (true)
			{
				webClient.Headers.Clear();
				webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
				webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
				webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
				webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
				webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.aMV6Mc");
				webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
				webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
				webClient.Headers.Add("Cookie", taoke_cookie);
				string text = "http://pub.alimama.com/campaign/merchandiseDetail.json?spm=a219t.7473494.1998155389.3.aMV6Mc&campaignId={campaignId}&shopkeeperId={shopkeeperId}&userNumberId={userNumberId}&tab=2&omid={userNumberId}&toPage={pageNo}&perPagesize=10&_tb_token_={tbtoken}&_input_charset=utf-8";
				string address = text.Replace("{pageNo}", string.Concat(num)).Replace("{campaignId}", campaignId).Replace("{shopkeeperId}", shopkeeperId).Replace("{userNumberId}", userNumberId).Replace("{tbtoken}", newValue);
				string text2 = "";
				byte[] array = webClient.DownloadData(address);
				string value = webClient.ResponseHeaders["Content-Encoding"];
				if (!"gzip".Equals(value))
				{
					text2 = Encoding.UTF8.GetString(array);
				}
				else
				{
					text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
				}
				string value2 = StringUtil.subString(text2, 0, "\"pagelist\":[{", ":");
				int num2 = 0;
				while ((num2 = text2.IndexOf(value2, num2)) != -1)
				{
					goodsItem = new GoodsItem5();
					goodsItem.user_type = StringUtil.subString(text2, num2, "\"userType\":", ",");
					goodsItem.user_num_id = StringUtil.subString(text2, num2, "\"userNumberId\":", ",");
					goodsItem.num_iid = StringUtil.subString(text2, num2, "\"auctionId\":", ",");
					goodsItem.title = StringUtil.subString(text2, num2, "\"title\":\"", "\",");
					goodsItem.pic_url = StringUtil.subString(text2, num2, "\"pictUrl\":\"", "\",");
					goodsItem.price = StringUtil.subString(text2, num2, "\"zkPrice\":", ",");
					goodsItem.ori_price = StringUtil.subString(text2, num2, "\"reservePrice\":", ",");
					try
					{
						goodsItem.volume = int.Parse(StringUtil.subString(text2, num2, "\"totalNum\":", ","));
						goto IL_2E5;
					}
					catch
					{
						goodsItem.volume = 0;
						goto IL_2E5;
					}
					IL_27A:
					num2++;
					continue;
					IL_2E5:
					goodsItem.commissionRatePercent = StringUtil.subString(text2, num2, "\"commissionRatePercent\":", ",");
					goodsItem.nick = StringUtil.subString(text2, num2, "\"nick\":\"", "\",");
					if (num_iid.Equals(goodsItem.num_iid))
					{
						goto Block_8;
					}
					goto IL_27A;
				}
				int num3 = int.Parse(StringUtil.subString(text2, 0, "\"pages\":", ","));
				if (num >= num3)
				{
					break;
				}
				if (num >= int_0 && int_0 != -1)
				{
					goto Block_7;
				}
				Thread.Sleep(500);
				num++;
			}
			result = null;
			return result;
			Block_7:
			result = null;
			return result;
			Block_8:
			result = goodsItem;
		}
		catch (Exception ex)
		{
			string_8 = "出错啦！！！" + ex.ToString();
			result = null;
		}
		return result;
	}
	public static ArrayList smethod_51(string string_3, string string_4)
	{
		ArrayList result;
		try
		{
			StringUtil.subString(string_4, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
			webClient.Headers.Add("Cookie", string_4);
			string address = "http://pub.alimama.com/campaign/joinedCampaigns.json?toPage=1&status=&nickname={nickname}&perPageSize=40&_input_charset=utf-8".Replace("{nickname}", HttpUtility.UrlEncode(string_3));
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text;
			if ("gzip".Equals(value))
			{
				text = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text = Encoding.UTF8.GetString(array);
			}
			ArrayList arrayList = new ArrayList();
			string text2 = text.Substring(text.IndexOf("pagelist"));
			int num = 0;
			while ((num = text2.IndexOf("\"id\"", num)) != -1)
			{
				CampaignBean campaignBean = new CampaignBean();
				int num2 = text2.IndexOf("\"id\"", num + 1);
				int length = text2.Length - num;
				if (num2 != -1)
				{
					length = num2 - num;
				}
				string text3 = text2.Substring(num, length);
				campaignBean.campaign_id = StringUtil.subString(text3, 0, "\"campaignId\":", ",");
				campaignBean.campaign_name = StringUtil.subString(text3, 0, "\"status\":", ",");
				campaignBean.campaign_type = StringUtil.subString(text3, 0, "\"refuseComments\":", ",\"").Replace("\"", "");
				if ("null".Equals(campaignBean.campaign_type))
				{
					campaignBean.campaign_type = "";
				}
				arrayList.Add(campaignBean);
				num++;
			}
			result = arrayList;
		}
		catch
		{
			result = new ArrayList();
		}
		return result;
	}
	public static bool smethod_52(ArrayList arrayList_0)
	{
		foreach (CampaignBean campaignBean in arrayList_0)
		{
			if (campaignBean.string_7.Equals("true"))
			{
				return true;
			}
		}
		return false;
	}
	public static ArrayList query_campaign_list(string taoke_cookie, string num_iid, out string out_log)
	{
		string text = "";
		ArrayList result;
		try
		{
			out_log = "";
			string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			ArrayList arrayList = new ArrayList();
			long num = AlimamaUtil.current_time();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/promo/search/index.htm?q=https%3A%2F%2Fitem.taobao.com%2Fitem.htm%3Fid%3D{itemId}&_t={timestamp}".Replace("{itemId}", num_iid).Replace("{timestamp}", string.Concat(num + 2100L)));
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
			webClient.Headers.Add("Cookie", taoke_cookie);
			string text2 = "http://pub.alimama.com/pubauc/getCommonCampaignByItemId.json?itemId={itemId}&t={timestamp}&_tb_token_={tbtoken}";
			string address = text2.Replace("{itemId}", num_iid).Replace("{timestamp}", string.Concat(num)).Replace("{tbtoken}", newValue);
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			if ("gzip".Equals(value))
			{
				text = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text = Encoding.UTF8.GetString(array);
			}
			if (text.Contains("\"data\":{}") || text.Contains("\"data\":[]") || text.Contains("\"data\":null"))
			{
				out_log = text;
				result = arrayList;
			}
			else
			{
				if (text.Contains("\"wait\""))
				{
					out_log = text;
					result = arrayList;
				}
				else
				{
					out_log = text;
					string value2 = StringUtil.subString(text, 0, "{\"data\":[{", ":");
					int num2 = 0;
					while (true)
					{
						num2 = text.IndexOf(value2, num2);
						if (num2 == -1)
						{
							break;
						}
						CampaignItem1 campaignItem = new CampaignItem1();
						campaignItem.commissionRate = double.Parse(StringUtil.subString(text, num2, "\"commissionRate\":", ","));
						campaignItem.CampaignID = StringUtil.subString(text, num2, "\"CampaignID\":", ",");
						campaignItem.CampaignName = StringUtil.subString(text, num2, "\"CampaignName\":\"", "\",");
						campaignItem.CampaignType = StringUtil.subString(text, num2, "\"CampaignType\":\"", "\",");
						string text3 = StringUtil.subString(text, num2, "\"AvgCommission\":\"", "\",");
						try
						{
							campaignItem.AvgCommission = double.Parse(text3.Replace("%", "").Replace(" ", ""));
						}
						catch
						{
							campaignItem.AvgCommission = 0.0;
						}
						campaignItem.Exist = StringUtil.subString(text, num2, "\"Exist\":", ",");
						campaignItem.ShopKeeperID = StringUtil.subString(text, num2, "\"ShopKeeperID\":", ",");
						campaignItem.Properties = StringUtil.subString(text, num2, "\"Properties\":", "\"");
						campaignItem.manualAudit = StringUtil.subString(text, num2, "\"manualAudit\":", ",");
						arrayList.Add(campaignItem);
						num2++;
					}
					result = arrayList;
				}
			}
		}
		catch (Exception ex)
		{
			out_log = "出错啦！！！" + text + "\n" + ex.ToString();
			result = null;
		}
		return result;
	}
	public static long current_time()
	{
		DateTime d = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1, 0, 0, 0, 0));
		return (long)(DateTime.Now - d).TotalMilliseconds;
	}
	public static AlimamaClick query_taoke_click(string taoke_cookie, string num_iid, string adzoneid, string siteid, int url_type, out string out_log)
	{
		AlimamaClick result;
		try
		{
			out_log = "";
			string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			long num = AlimamaUtil.current_time();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/promo/search/index.htm?q=https%3A%2F%2Fitem.taobao.com%2Fitem.htm%3Fid%3D{itemId}&_t={timestamp}".Replace("{itemId}", num_iid).Replace("{timestamp}", string.Concat(num - 4100L)));
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
			webClient.Headers.Add("Cookie", taoke_cookie);
			string text = "http://pub.alimama.com/common/code/getAuctionCode.json?auctionid={itemId}&adzoneid={adzoneid}&siteid={siteid}&scenes=1&t={timestamp}&pvid={pvid}&_tb_token_={tbtoken}&_input_charset=utf-8";
			if (url_type == 1)
			{
				text = "http://pub.alimama.com/common/code/getAuctionCode.json?auctionid={itemId}&adzoneid={adzoneid}&siteid={siteid}&scenes=3&channel=tk_qqhd&t={timestamp}&_tb_token_={tbtoken}&pvid={pvid}";
			}
			string address = text.Replace("{itemId}", num_iid).Replace("{adzoneid}", adzoneid).Replace("{siteid}", siteid).Replace("{timestamp}", string.Concat(num)).Replace("{tbtoken}", newValue).Replace("{pvid}", AlimamaUtil.query_pvid(taoke_cookie));
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			if (text2.Contains("\"info\":{\"message\":null,\"ok\":true},\"ok\":true"))
			{
				AlimamaClick alimamaClick = new AlimamaClick();
				alimamaClick.url = StringUtil.subString(text2, 0, "\"clickUrl\":\"", "\"");
				alimamaClick.coupon_url = StringUtil.subString(text2, 0, "\"couponLink\":\"", "\"");
				alimamaClick.short_url = StringUtil.subString(text2, 0, "\"shortLinkUrl\":\"", "\"");
				alimamaClick.tao_token = StringUtil.subString(text2, 0, "\"taoToken\":\"", "\"");
				alimamaClick.coupon_link_tao_token = StringUtil.subString(text2, 0, "\"couponLinkTaoToken\":\"", "\"");
				alimamaClick.num_iid = num_iid;
				out_log = "";
				result = alimamaClick;
			}
			else
			{
				out_log = text2;
				result = null;
			}
		}
		catch (Exception ex)
		{
			out_log = "出错啦！！！" + ex.ToString();
			result = null;
		}
		return result;
	}
	public static GoodsItem2 query_taoke_item_event(string taoke_cookie, string num_iid, out string out_log)
	{
		ArrayList arrayList = AlimamaUtil.query_taoke_item_event_list(taoke_cookie, "&q=" + HttpUtility.UrlEncode("https://item.taobao.com/item.htm?id=" + num_iid), out out_log);
		if (arrayList != null && arrayList.Count != 0)
		{
			return (GoodsItem2)arrayList[0];
		}
		return null;
	}
	public static ArrayList query_taoke_item_event_list(string taoke_cookie, string string_4, out string out_log)
	{
		ArrayList result;
		try
		{
			out_log = "";
			string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
			WebClient webClient = new WebClient();
			long num = AlimamaUtil.current_time();
			webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
			webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
			webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
			webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
			webClient.Headers.Add("Referer", "http://pub.alimama.com/promo/item/channel/index.htm?channel=qqhd&_t={timestamp}{schCon}".Replace("{timestamp}", string.Concat(num)).Replace("{schCon}", string_4));
			webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
			webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3");
			webClient.Headers.Add("Cookie", taoke_cookie);
			string text = "http://pub.alimama.com/items/channel/qqhd.json?channel=qqhd&perPageSize=50&shopTag=&t={timestamp}{schCon}&_tb_token_={tbtoken}";
			string address = text.Replace("{timestamp}", string.Concat(num)).Replace("{schCon}", string_4).Replace("{tbtoken}", newValue);
			byte[] array = webClient.DownloadData(address);
			string value = webClient.ResponseHeaders["Content-Encoding"];
			string text2;
			if ("gzip".Equals(value))
			{
				text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
			}
			else
			{
				text2 = Encoding.UTF8.GetString(array);
			}
			int num2 = 0;
			ArrayList arrayList = new ArrayList();
			while ((num2 = text2.IndexOf("tkSpecialCampaignIdRateMap", num2)) != -1)
			{
				arrayList.Add(new GoodsItem2
				{
					num_iid = StringUtil.smethod_1(text2, num2, "\"auctionId\":", ",", "}"),
					title = GzipUtil.html_to_text(StringUtil.smethod_1(text2, num2, "\"title\":\"", "\",", "}")),
					shop_title = StringUtil.smethod_1(text2, num2, "\"shopTitle\":\"", "\",", "}"),
					user_num_id = StringUtil.smethod_1(text2, num2, "\"sellerId\":", ",", "}"),
					pictUrl = StringUtil.smethod_1(text2, num2, "\"pictUrl\":\"", "\",", "}"),
					dayLeft = int.Parse(StringUtil.smethod_1(text2, num2, "\"dayLeft\":", ",", "}")),
					userType = int.Parse(StringUtil.smethod_1(text2, num2, "\"userType\":", ",", "}")),
					biz30day = int.Parse(StringUtil.smethod_1(text2, num2, "\"biz30day\":", ",", "}")),
					zkPrice = double.Parse(StringUtil.smethod_1(text2, num2, "\"zkPrice\":", ",", "}")),
					eventRate = double.Parse(StringUtil.smethod_1(text2, num2, "\"eventRate\":", ",", "}")),
					tkCommFee = double.Parse(StringUtil.smethod_1(text2, num2, "\"tkCommFee\":", ",", "}")),
					couponAmount = double.Parse(StringUtil.smethod_1(text2, num2, "\"couponAmount\":", ",", "}")),
					couponStartFee = double.Parse(StringUtil.smethod_1(text2, num2, "\"couponStartFee\":", ",", "}")),
					couponTotalCount = int.Parse(StringUtil.smethod_1(text2, num2, "\"couponTotalCount\":", ",", "}")),
					couponLeftCount = int.Parse(StringUtil.smethod_1(text2, num2, "\"couponLeftCount\":", ",", "}"))
				});
				num2++;
			}
			out_log = text2;
			result = arrayList;
		}
		catch (Exception ex)
		{
			out_log = "出错啦！！！" + ex.ToString();
			result = null;
		}
		return result;
	}
	public static ArrayList smethod_58(string string_3)
	{
		string newValue = StringUtil.subString(string_3, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/common/site/generalize/guideList.json?t={timestamp}&pvid=&_tb_token_={_tb_token_}&_input_charset=utf-8";
		text = text.Replace("{timestamp}", string.Concat(AlimamaUtil.current_time())).Replace("{_tb_token_}", newValue);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_3);
		byte[] array = webClient.DownloadData(text);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text2;
		if ("gzip".Equals(value))
		{
			text2 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text2 = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		string value2 = "\"" + StringUtil.subString(text2, 0, "\"guideList\":[{\"", "\"") + "\"";
		int num = 0;
		while ((num = text2.IndexOf(value2, num)) != -1)
		{
			arrayList.Add(new GuideItem
			{
				string_0 = StringUtil.subString(text2, num, "\"name\":\"", "\""),
				string_1 = StringUtil.subString(text2, num, "\"memberID\":", ","),
				string_2 = StringUtil.subString(text2, num, "\"guideID\":", ","),
				string_3 = StringUtil.subString(text2, num, "\"siteType\":\"", "\""),
				string_4 = StringUtil.subString(text2, num, "\"category2\":\"", "\""),
				string_5 = StringUtil.subString(text2, num, "\"category3\":\"", "\"")
			});
			num++;
		}
		return arrayList;
	}
	public static ArrayList parse_Adzone(string body, int ad_type)
	{
		string text = "";
		if (ad_type == 1)
		{
			text = "\"webAdzones\":[";
		}
		if (ad_type == 2)
		{
			text = "\"appAdzones\":[";
		}
		if (ad_type == 3)
		{
			text = "\"otherAdzones\":[";
		}
		if (body.IndexOf(text) == -1)
		{
			return new ArrayList();
		}
		string text2 = AlimamaUtil.smethod_7(body, text, "[", "]");
		ArrayList arrayList = new ArrayList();
		while (text2.StartsWith("{"))
		{
			string text3 = "{" + AlimamaUtil.smethod_7(text2, "{", "{", "}") + "}";
			text2 = text2.Replace(text3, "").Replace("{}", "");
			if (text2.StartsWith(","))
			{
				text2 = text2.Substring(1);
			}
			arrayList.Add(text3);
		}
		ArrayList arrayList2 = new ArrayList();
		foreach (string text4 in arrayList)
		{
			string text5 = AlimamaUtil.smethod_7(text4, "\"sub\":[", "[", "]");
			if (text5.Equals(""))
			{
				text5 = "\"sub\":[]";
			}
			string text6 = text4.Replace(text5, "");
			AdZonesItem adZonesItem = new AdZonesItem();
			adZonesItem.id = StringUtil.smethod_1(text6, 0, "\"id\":\"", "\"", "}");
			adZonesItem.name = StringUtil.subString(text6, 0, "\"name\":\"", "\"");
			ArrayList arrayList3 = new ArrayList();
			string value = "\"" + StringUtil.subString(text5, 0, "{\"", "\"") + "\"";
			int num = 0;
			while ((num = text5.IndexOf(value, num)) != -1)
			{
				arrayList3.Add(new AdZonesSubItem
				{
					id = StringUtil.smethod_1(text5, num, "\"id\":", ",", "}"),
					name = StringUtil.subString(text5, num, "\"name\":\"", "\"")
				});
				num++;
			}
			adZonesItem.sub_list = arrayList3;
			arrayList2.Add(adZonesItem);
		}
		return arrayList2;
	}
	public static string smethod_7(string string_3, string string_4, string string_5, string string_6)
	{
		int num = string_3.IndexOf(string_4) + string_4.Length;
		if (num == string_4.Length - 1)
		{
			return "";
		}
		int num2 = 0;
		int num3 = 0;
		for (int i = num; i < string_3.Length; i++)
		{
			string text = string_3.Substring(i, 1);
			if (text.Equals(string_5))
			{
				num3--;
			}
			if (text.Equals(string_6))
			{
				num3++;
			}
			if (num3 == 1)
			{
				num2 = i;
				break;
			}
		}
		return string_3.Substring(num, num2 - num);
	}
	public static ArrayList smethod_8(string string_3, string string_4)
	{
		string format = "http://pub.alimama.com/pubshop/shopKeeperHotProducts.json?sortField=_totalnum&oid={0}";
		string address = string.Format(format, string_3);
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
		webClient.Headers.Add("Referer", "http://pub.alimama.com/myunion.htm?spm=a219t.7473494.1998155389.3.M5DAMr");
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		webClient.Headers.Add("Cookie", string_4);
		byte[] array = webClient.DownloadData(address);
		string value = webClient.ResponseHeaders["Content-Encoding"];
		string text;
		if ("gzip".Equals(value))
		{
			text = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		int num = 0;
		while ((num = text.IndexOf("\"title\"", num)) != -1)
		{
			arrayList.Add(new GoodsItem3
			{
				title = StringUtil.subString(text, num, "\"title\":\"", "\""),
				num_iid = StringUtil.subString(text, num, "\"auctionId\":\"", "\"")
			});
			num++;
		}
		return arrayList;
	}
	public static ArrayList query_taoke_goods_list(string url, string taoke_cookie, out string out_log)
	{
		string newValue = StringUtil.subString(taoke_cookie, 0, "_tb_token_=", ";");
		string text = "http://pub.alimama.com/items/search.json?q={seachkey}&_t={timestamp}&auctionTag=&perPageSize=40&shopTag=&t={timestamp}&_tb_token_=test&pvid={pvid}";
		string address = text.Replace("{seachkey}", HttpUtility.UrlEncode(url)).Replace("{timestamp}", string.Concat(AlimamaUtil.current_time())).Replace("{token}", newValue).Replace("{pvid}", AlimamaUtil.query_pvid(taoke_cookie));
		string text2 = "http://pub.alimama.com/promo/search/index.htm?q={seachkey}&_t={timestamp}";
		string value = text2.Replace("{seachkey}", HttpUtility.UrlEncode(url)).Replace("{timestamp}", string.Concat(AlimamaUtil.current_time()));
		WebClient webClient = new WebClient();
		webClient.Headers.Add("Accept", "application/json, text/javascript, */*; q=0.01");
		webClient.Headers.Add("X-Requested-With", "XMLHttpRequest");
		webClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36");
		webClient.Headers.Add("Referer", value);
		webClient.Headers.Add("Accept-Encoding", "gzip,deflate,sdch");
		webClient.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8");
		byte[] array = webClient.DownloadData(address);
		string value2 = webClient.ResponseHeaders["Content-Encoding"];
		string text3;
		if ("gzip".Equals(value2))
		{
			text3 = GzipUtil.zip_to_string(array, Encoding.UTF8);
		}
		else
		{
			text3 = Encoding.UTF8.GetString(array);
		}
		ArrayList arrayList = new ArrayList();
		int num = 0;
		while ((num = text3.IndexOf("\"tkSpecialCampaignIdRateMap\"", num)) != -1)
		{
			arrayList.Add(new GoodsItem2
			{
				num_iid = StringUtil.smethod_1(text3, num, "\"auctionId\":", ",", "}"),
				title = StringUtil.smethod_1(text3, num, "\"title\":\"", "\",", "}"),
				shop_title = StringUtil.smethod_1(text3, num, "\"shopTitle\":\"", "\",", "}"),
				user_num_id = StringUtil.smethod_1(text3, num, "\"sellerId\":", ",", "}"),
				pictUrl = StringUtil.smethod_1(text3, num, "\"pictUrl\":\"", "\",", "}"),
				dayLeft = int.Parse(StringUtil.smethod_1(text3, num, "\"dayLeft\":", ",", "}")),
				userType = int.Parse(StringUtil.smethod_1(text3, num, "\"userType\":", ",", "}")),
				biz30day = int.Parse(StringUtil.smethod_1(text3, num, "\"biz30day\":", ",", "}")),
				zkPrice = double.Parse(StringUtil.smethod_1(text3, num, "\"zkPrice\":", ",", "}")),
				tkCommFee = double.Parse(StringUtil.smethod_1(text3, num, "\"tkCommFee\":", ",", "}")),
				tkRate = double.Parse(StringUtil.smethod_1(text3, num, "\"tkRate\":", ",", "}"))
			});
			num++;
		}
		out_log = text3;
		return arrayList;
	}
}
